/*
 * 用户管理模块
 * 导入方式：
 * 1.导入所有
 *  import * as $axios from '../utils/axios'
 * 2.按需导入
 *   import {get, post} from '../utils/axios'
 * 3.别名导入
 *   import {get as gg, post as pp} from '../utils/axios'
 */

import {get, post, postJson} from '../utils/axios'

// 根据用户名查找
export const getUserById1 = (id: number) => {
    return get(`/user/getUserById1/${id}`)//此处不能使用单引号
}
export const getUserById2 = (id: number) => {
    return get('/user/getUserById2', {id: id})
}

// 获取验证码
export const checkVerifyCode = (data: Record<string, string>): any => {
    return get('/user/checkVerifyCode', data)
}

// 登录
export const login = (data: Record<string, string>): any => {
    return post('/user/login', data)
}

// 注册
export const regist = (data: Record<string, string>): any => {
    return post('/user/regist', data)
}

// 保存
export const createUser = (data: any) => {
    return post('/user/increate', data)
}
// // 删除
// export const batchDelete = (data) => {
//   return get({
//     url: '/user/delete',
//     method: 'post',
//     data
//   })
// }
// 分页查询
export const findPage = (data: any) => {
    return postJson('/user/list', data)
}
//查询所有
export const findAll = () => {
    return postJson('/user/listUser')
}
// // 导出Excel用户信息
// export const exportUserExcelFile = (data) => {
//   return $axios({
//     url: '/user/exportUserExcelFile',
//     method: 'post',
//     data
//   })
// }
// // 查找用户的菜单权限标识集合
// export const findPermissions = (params) => {
//   return $axios({
//     url: '/user/findPermissions',
//     method: 'get',
//     params
//   })
// }

// // 更新用户密码
// export const updatePassword = (params) => {
//   return $axios({
//     url: '/user/updatePassword',
//     method: 'get',
//     params
//   })
// }
